package com.phonegap.breastmilk;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class Connection {
	
	private static Connection connection = null;
	private BreastmilkSQLiteHelper bmdb = null;
	
	private Connection(Context context) {
		bmdb = new BreastmilkSQLiteHelper(context, "Feeding_Diary", null, 1);
	}
	
	public static Connection getInstance(Context context) {
		if (connection == null) {
			connection = new Connection(context);
		} 
		return connection;
	}
	
	public SQLiteDatabase getWritableDatabase() {
		return bmdb.getWritableDatabase();
	}
	
	public SQLiteDatabase getReadableDatabase() {
		return bmdb.getReadableDatabase();
	}
}
